package com.sun.app.process.front.user;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sun.app.process.BaseProcess;

public class SetProcess extends BaseProcess {

	@Override
	public HashMap<String, Object> execute(HttpServletRequest request,
			HttpServletResponse response, HashMap<String, Object> model)
			throws Exception {
		// TODO Auto-generated method stub
		String UID;
		try {
			UID = (String) request.getSession().getAttribute("UID");
			if(UID==null ){
				this.setSuccessView("login");
				return model;
			}
			this.setSuccessView("front/user/setting");
		} catch (Exception e) {
			// TODO Auto-generated catch block
			this.setSuccessView("login");
			return model;
		}
		
		// 用户信息
		Map userModel = getServMgr().getUserService().getUserById(UID,null);
		List provinceList = getServMgr().getComboService().getProvice();
		System.out.println(userModel);
		// SET用户信息
		model.put("user", userModel);
		model.put("provices", provinceList);
		
		List TIPCatalog = getServMgr().getTipService().getRegisterTIPCatalog();
		System.out.println(TIPCatalog);
		List HotTIP = getServMgr().getTipService().getRegHotTIP();
		model.put("tipCatalog", TIPCatalog);
		model.put("hotTIP", HotTIP);
		return model;
	}

}